<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta charset="UTF-8">
<script type="text/javascript"
	src="${pageContext.request.contextPath}/My97DatePicker/WdatePicker.js"></script>
<link rel="stylesheet" type="text/css"
	href="${pageContext.request.contextPath}/css/css/base2.css">
<link rel="stylesheet" type="text/css"
	href="${pageContext.request.contextPath}/css/css/style2.css">
<script type="text/javascript"
	src="${pageContext.request.contextPath}/js/jquery-2.1.4.min.js"></script>
<title>财务管理-提现管理-待处理</title>
</head>
<body>
	<div class="page">

		<div class="main clearfix">
			<div class="main_menu fl">
				<c:forEach items="${sessionScope.MENU_LIST}" var="mainMenu">
					<c:if test="${mainMenu.wOOpid == 3}">
						<div class="menu_name">
							<a href="${pageContext.request.contextPath}/${mainMenu.wOAction}"
								target="main"> <img
								src="${pageContext.request.contextPath}${mainMenu.wOIcon}">
								<p>${mainMenu.wOName}</p>
							</a>
						</div>
					</c:if>
				</c:forEach>
			</div>
			<div class="main_cont fl">
				<div class="main_cont_top">
					<div class="main_inner clearfix">
						
						<div class="cont_top_time fr">
							<i> <a
							href="${pageContext.request.contextPath}/supplier/listWithDrawInfoP/1.html"><img
								src="${pageContext.request.contextPath}/images/images/refresh.png">刷新</a></i>
						</div>
					</div>
				</div>
				<div class="main_cont_top">
					<div class="main_inner clearfix">
						<div class="cont_top_time fr pr">
							<form>
								<input type="search" placeholder="请输入关键字查询" class="search_txt">
								<input type="submit" value="搜索" class="search pa"
									style="top: 6px; right: 0;">
							</form>
						</div>
					</div>
				</div>
				<div class="main_cont_bottom_txmxDcl">
					<div class="main_inner">
						<ul class="main_cont_title clearfix">
							<li><a
								href="${pageContext.request.contextPath}/supplier/listWithDrawInfo/1.html">已通过</a>
							</li>
							<li><a
								href="${pageContext.request.contextPath}/supplier/listWithDrawInfoP/1.html"
								class="on">待处理</a></li>
						</ul>
						<table
							class="table table-border table-bordered table-hover table-bg table-sort">
							<thead>
								<tr>
									<th><input type="checkbox" class="checked"></th>
									<th>渠道商名</th>
									<th>申请时间</th>
									<th>提现账号</th>
									<th>提现银行</th>
									<th>账户名称</th>
									<th>提现金额</th>
									<th>手续费</th>
									<th>状态</th>
									<th>操作</th>
								</tr>
							</thead>

							<tbody>
								<c:forEach items="${PAGE_BEAN.dataList}" var="withdrawInfo">
									<tr>
										<td><input type="checkbox" class="checked"></td>
										<td><c:out value="${withdrawInfo.supplierName}" /></td>
										<td><c:out value="${withdrawInfo.formatDate}" /></td>
										<td><c:out value="${withdrawInfo.wPBankNo}" /></td>
										<td><c:out value="${withdrawInfo.wPBankName}" /></td>
										<td><c:out value="${withdrawInfo.wPAccountName}" /></td>
										<td><c:out value="${withdrawInfo.wPAmount}" /></td>
										<td><c:out value="${withdrawInfo.wPFee}" /></td>
										<td><c:if test="${withdrawInfo.status == 1}">
												<span>待处理</span></td>
										</c:if>
										</td>
										<td><a href="javascript:void()" onclick="payend(${withdrawInfo.id})">完成</a></td>
									</tr>
								</c:forEach>
							</tbody>
						</table>
						<%@ include file="/WEB-INF/views/page.jsp"%>

					</div>
				</div>
			</div>
		</div>
	</div>
	<script type="text/javascript"
		src="${pageContext.request.contextPath}/lib/datatables/1.10.0/jquery.dataTables.min.js"></script>
	<script>
		$(function() {
			$('.table-sort').dataTable({
				"bLengthChange" : false, //改变每页显示数据数量
				"aaSorting" : [ [ 1, "desc" ] ],//默认第几个排序
				"bStateSave" : true,//状态保存
				"bPaginate" : false,// 分页按钮  
				"aoColumnDefs" : [
				//{"bVisible": false, "aTargets": [ 3 ]} //控制列的隐藏显示
				{
					"orderable" : false,
					"aTargets" : [ 0, 3, 3 ]
				} // 制定列不参与排序
				]
			});
		});
		
		function payend(id){
			 if(id!=""){
					$.ajax({
					 	url:"/supplier/payend/"+id+".json",
						success: function(data){
							alert(data.info);
							window.location.reload();
						}
					}); 
			 }
		}
	</script>
</body>
</html>
